<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>业务消息管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/wechat/businessNewsReply/">业务消息列表</a></li>
		<li class="active"><a href="${ctx}/wechat/businessNewsReply/form?id=${businessNewsReply.id}">业务消息<shiro:hasPermission name="wechat:businessNewsReply:edit">${not empty businessNewsReply.id?'修改':'添加'}</shiro:hasPermission><shiro:lacksPermission name="wechat:businessNewsReply:edit">查看</shiro:lacksPermission></a></li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="businessNewsReply" action="${ctx}/wechat/businessNewsReply/save" method="post" class="form-horizontal"  enctype="multipart/form-data">
		<form:hidden path="id"/>
		<tags:message content="${message}"/>
		<form:hidden path="user.id"/>
		<form:hidden path="type"/>
		<tags:message content="${message}"/>
		
			<label class="control-label">图片标题:</label>
			<div   class="controls" >
					<form:input type="text" path="title" htmlEscape="false" id="pic_title"  class="required"/>
				</div>
				
				<label class="control-label">链接地址:</label>
				<div   class="controls" style="margin-top:5px;margin-buttom:5px;">
					<form:input type="text" path="url" htmlEscape="false"  class="required"  id="pic_url"/>  &nbsp; <span class="alert">必须以 http://开头.</span>
				</div>
				
				<label class="control-label">排序:</label>
				<div class="controls" id="uploadfile" style="margin-top:5px;margin-buttom:5px;">
					<form:input type="text" path="sort" htmlEscape="false"  class="required digsts"  />    
				</div>
				<label class="control-label">图片描述:</label>
				<div   class="controls" style="margin-top:5px;margin-buttom:5px;">
					<form:textarea id="pic_desc" path="description" htmlEscape="false"  cols="6" rows="5" class="required"/>
				</div>
				<label class="control-label">上传文件:</label>
				<div class="controls" id="uploadfile">
					<input type="file"  name="picfile"/> <span class="alert">大图片建议尺寸：720像素 * 400像素;  &nbsp; 小图片建议尺寸：400像素 * 400像素</span>    
				</div>		
				
				<div class="form-actions">
			<shiro:hasPermission name="wechat:businessNewsReply:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>
	</form:form>
</body>
</html>
